<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
    <script>
        //扩展运算符可以将数组拆分成以逗号分隔的参数序列
        let ary = [1,2,3];
        console.log(...ary);

        let ary1 = [1,2,3];
        let ary2 = [4,5,6];
        let ary3 = [...ary1,...ary2];
        console.log(ary3);

        ary1.push(...ary2);
        console.log(ary1);

        //将伪数组转换成真正的数组 可调用数组的方法
        var oDivs = document.querySelectorAll('li');
        console.log(oDivs);
        var ary6 = [...oDivs];
        ary6.push('a');
        console.log(ary6);

        let arrayLike = {
            '0':1,
            '1':2,
            'length':2,
        };
        var ary4 = Array.from(arrayLike);
        var ary5 = Array.from(arrayLike,item => item*2);
        console.log(ary4);
        console.log(ary5);
    </script>
</body>
</html>